In the prior art, a magnetic resistance element has a structure shown in FIG. 2. That is, a ferromagnetic thin film 2 comprising a Ni--Fe alloy, a Ni--Co alloy, etc. is formed on a substrate such as glass, ceramics of alumina, etc., and a protective film 3 is formed on the ferromagnetic thin film 2. As the protective film 3, there has been generally used a silicon oxide layer with a film thickness of 10 to 30 .mu.m formed from silicon oxide by a CVD method, sputtering, etc. or a thin layer with a film thickness of 5 to 10 .mu.m comprising a non-water permeable resin such as a polyimide resin, an epoxy resin or a polyamide resin, etc. A lead wire 5 is connected with the end portion of the ferromagnetic thin film 2 by means of solder 4. A mounting portion by the solder 4 is covered with a resin 6.
However, in the protective film 3 comprising silicon oxide, fine cracks and pinholes exist so that water is penetrated through these cracks and pinholes, whereby there involves a problems that the ferromagnetic thin film 2 comprising a Ni--Co alloy, etc. is corroded. For this reason, in the prior art, the film thickness of the protective film 3 has been made as thick as 10 to 30 .mu.m to decrease fine cracks and pinholes, whereby moisture resistance is improved. However, it is impossible to prevent cracks and pinholes completely, and there still involves a problem that the ferromagnetic thin film 2 is corroded by water.
Further, when the film thickness of the protective film 3 is made thick, there involve problems that a distance between the ferromagnetic thin film 2 and a magnetic material to be detected is broadened so that detection output is lowered, and cracks are easily formed on the substrate and the protective film 3 by thermal shock since thermal expansion rate of the ferromagnetic thin film 2 comprising a metal is greatly different from those of the substrate 1 comprising ceramics and the protective film 3.
Also, when the protective film 3 comprising a non-water permeable resin such as a polyimide resin, an epoxy resin or a polyamide resin, etc. is formed on the ferromagnetic thin film 2, there involve a problem that a resin is coated in the air so that molecules of water adsorbed on the ferromagnetic thin film 2 are encapsulated by the resin, and the ferromagnetic thin film 2 is corroded by the molecules of water or a minute amount of water contained in the resin.
An object of the present invention is to solve the above problems, and to provide a magnetic resistance element in which moisture resistance is excellent, detected output is enlarged by making the film thickness of a protective film thinner and no crack is formed by thermal shock, and a method for preparing the same.